﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Wp.DAL;
using Wp.BLL;

public partial class Modules_Pages_Controls_PageDetail : System.Web.UI.UserControl
{
    public string PostTextId { get; set; }
    protected void Page_Load(object sender, EventArgs e)
    {
        PostTextId = CommonHelper.QueryString("PostTextId", "");
        if (!IsPostBack)
        {
            LoadData();

        }
    }
    void LoadData()
    {
        TblPostsEntity item = TblPostsManager.CreateInstant().SelectOneByTextId(PostTextId, "page", false);
        if (item != null)
        {
            List<TblPostsEntity> ls = new List<TblPostsEntity>();
            ls.Add(item);
            rpt.DataSource = ls;
            rpt.DataBind();
            //LiteralTitle.Text = item.Title;
            //SEO(item);
            //LoadTag(item.Id);
            //LoadViewMore(item.CreatedDate, item.lsTermRelationships[0].Slug);
            //TblPostMetaEntity imeta = TblPostMetaManager.CreateInstant().SelectOne(item.Id, "NumView");
            //if (imeta == null)
            //{
            //    imeta = new TblPostMetaEntity();
            //    imeta.Id = -1;
            //    imeta.PostId = item.Id;
            //    imeta.MetaKey = "NumView";
            //    imeta.MetaValue = "1";
            //}
            //else
            //{
            //    imeta.MetaValue = (imeta.MetaValue.ToInt() + 1).ToString();
            //}
            //TblPostMetaManager.CreateInstant().InsertUpdate(imeta);
            //LoadComment(item.Id, -1, "new");
        }
    }
}